using System;
using System.Reflection;
using System.Diagnostics;
using System.ServiceProcess;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;

namespace PickGold.Forms
{
	[RunInstaller(true)]
	public class CInstaller_base : Installer
	{
		protected ServiceProcessInstaller _ServiceProcessInstaller;
		protected ServiceInstaller _ServiceInstaller;

		public CInstaller_base() : base()
		{
			this._ServiceProcessInstaller = new ServiceProcessInstaller();
			this._ServiceInstaller = new ServiceInstaller();

			this.InitializeComponent();

			this.Installers.Add(this._ServiceProcessInstaller);
			this.Installers.Add(this._ServiceInstaller);
		}

		protected virtual void InitializeComponent()
		{
			this._ServiceProcessInstaller.Account = ServiceAccount.LocalSystem;
			this._ServiceProcessInstaller.Password = null;
			this._ServiceProcessInstaller.Username = null;

			this._ServiceInstaller.DisplayName = Process.GetCurrentProcess().ProcessName;
			this._ServiceInstaller.ServiceName = Process.GetCurrentProcess().ProcessName;
			this._ServiceInstaller.StartType = ServiceStartMode.Automatic;
		}

	}
}
